package com.huaxiafinance.management.util;


import org.apache.log4j.Logger;

import java.text.SimpleDateFormat;
import java.util.Date;


public class TokenUtil
{
    private static final String KEY = "epGESPRmUvAcPtX";

    private static final Logger logger = Logger.getLogger(TokenUtil.class);

    public static String converToToken(String cellphone)
    {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String token = "cellphone=" + cellphone + "@" + "timestamp=" + sdf.format(new Date());
        try
        {
            token = DesUtil.encrypt(token, KEY);
        }
        catch (Exception e)
        {
            logger.error("错误++++++" + e);
        }
        return token;
    }
}